import { GameData } from "../game/GameData";
import { GameState } from "../game/GameState";
import { DaliyTaskData, GroupTaskData } from "../game/GameDefine";
cc.Class({
    extends: require('BasePanel'),

    properties: {
        nodScvDaliy: cc.Node,
        nodScvGroup: cc.Node,
        nodContentDaliy: cc.Node,
        nodContentGroup: cc.Node,
        pfbItemTask: cc.Prefab,
    },
    onLoad() {
        this._super();

        for (let i = 0; i < DaliyTaskData.length; i++) {
            let node = cc.instantiate(this.pfbItemTask);
            node.parent = this.nodContentDaliy;
            node.getComponent('ItemTask').init(1, i);
        }
        for (let i = 0; i < GroupTaskData.length; i++) {
            let node = cc.instantiate(this.pfbItemTask);
            node.parent = this.nodContentGroup;
            node.getComponent('ItemTask').init(2, i);
        }
    },

    onEnter(args, action = true) {
        this._super(args, action);
        
    },

    onExit(args) {
        this._super(args);
    },

    show() {
        this._super();

    },

    hide(cb) {
        this._super(cb);
    },
    onEnable() {

    },
    onDisable() {
    },

    buttonListener: function (button) {
        G.game.gameAudioMgr.playBtn();
        let name = button.node.name;
        if (name == 'btnClose') {
            this.onClose();
        } else if (name == 'btnDaliy') {
            this.nodScvDaliy.active = true;
            this.nodScvGroup.active = false;
        } else if (name == 'btnGroup') {
            this.nodScvDaliy.active = false;
            this.nodScvGroup.active = true;
        }
    },

    onTouchStart() {

    },
});
